// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-6-24

#ifndef __JOYWNDCONTAINER_H_COMMON_UI__
#define __JOYWNDCONTAINER_H_COMMON_UI__

#pragma once
#include "wnd.h"

//##ModelId=44C4B6020011
class CJoyWndContainer :
    public CJoyWnd
{
	DECLARE_DYNAMIC(CJoyWndContainer)
protected:
	//##ModelId=44C4B6020020
    CRect   m_margin;
	//##ModelId=44C4B6020022
    CWnd*   m_pWnd;


	//##ModelId=44C4B6020026
    void ValidateArea(int cx, int cy);
	//##ModelId=44C4B6020030
    virtual void DoAlignChilds(CRect& remain);

	//##ModelId=44C4B6020033
    virtual void CM_LoadSkin(CJoyXmlElement* pSkinElem);
	//##ModelId=44C4B6020040
    virtual void CM_Draw(Graphics& graph);
public:
	//##ModelId=44C4B6020043
    CJoyWndContainer(void);
	//##ModelId=44C4B6020045
    virtual ~CJoyWndContainer(void);

	//##ModelId=44C4B6020050
    void SetMargin(const CRect& margin);
	//##ModelId=44C4B6020052
    void SetWnd(CWnd* pWnd);
	//##ModelId=44C4B6020054
    CWnd* GetWnd() const
    {
        return m_pWnd;
    }

public:
    DECLARE_MESSAGE_MAP()
	//##ModelId=44C4B602005D
    afx_msg void OnSize(UINT nType, int cx, int cy);
	//##ModelId=44C4B6020062
    afx_msg void OnDestroy();
};


#endif  // __JOYWNDCONTAINER_H_COMMON_UI__
